package cate.common.table.res.farm.sheet;

import cate.common.table.ESheet;
import cate.common.table.res.farm.row.FarmSeedLevelRow;

import java.util.List;
import java.util.stream.Collectors;

public class FarmSeedLevelSheet extends ESheet<FarmSeedLevelRow> {
    @Override
    public String getSheetName() {
        return "种子升级";
    }

    public FarmSeedLevelRow getNextLevelRow(byte seedType, int seedLevel) {
        return getList().stream().filter(e -> e.seedType == seedType && e.seedLevel == seedLevel + 1).findAny().orElse(null);
    }

    public List<FarmSeedLevelRow> getSeedCostRows(byte seedType, int minLevel, int maxLevel) {
        return getList().stream().filter(e -> e.seedType == seedType && e.seedLevel > minLevel && e.seedLevel <= maxLevel).collect(Collectors.toList());
    }
}
